#parse mtl
import util
result_array=[]
def load():
    print("输入obj文件路径")
    obj_file_path="output.obj"#input()
    file=open(obj_file_path,"r")
    parse(file)
    pass
def parse(file):
    for i in file.readlines():
        block={}
        if "newmtl" in i:
            mtl_index=i.split("newmtl")[1].strip()
        if "Ka" in i:
            Ka_x=util.split_x_y_z("Ka",i)[0]
            Ka_y=util.split_x_y_z("Ka",i)[1]
            Ka_z=util.split_x_y_z("Ka",i)[2]
        if "Kd" in i:
            Kd_x=util.split_x_y_z("Kd",i)[0]
            Kd_y=util.split_x_y_z("Kd",i)[1]
            Kd_z=util.split_x_y_z("Kd",i)[2]
        if "d" in i:
            d=util.split_head("d",i)
        if "map_Kd" in i:
            map_Kd=util.split_head("map_Kd",i)
            block["map_Kd"]=map_Kd
            result_array.append(block)